package com.lagou.edu.wwyan.web1.minicat;

import java.util.List;

public class Engine implements  LifeCycle{
    private List<Host> hosts;

    public Engine(List<Host> hosts) {
        this.hosts = hosts;
    }

    public Engine() {
    }

    @Override
    public void init() {
        for (Host host : hosts) {
            host.init();
        }
    }

    @Override
    public void start() {
        for (Host host : hosts) {
            host.start();
        }
    }
}
